﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApAPPSubTask
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

public class CApAPPSubTask
{
  private CApAPPTask m_task;
  private KiAppSubTaskEx m_kiSubTask;

  public CApAPPSubTask(CApAPPSubTask i_other) => this.KiSubTask = i_other.KiSubTask;

  internal CApAPPSubTask(KiAppSubTaskEx i_subtask) => this.KiSubTask = i_subtask;

  public ITxOperation Operation => this.KiSubTask.Operation;

  public CApAPPTask Task
  {
    get => this.m_task;
    set => this.m_task = value;
  }

  public bool IsToPlan() => this.KiSubTask.IsToPlan;

  public void WaypointIndexes(ref int o_firstIndex, ref int o_secondIndex)
  {
    o_firstIndex = this.KiSubTask.SourceWaypointIndex;
    o_secondIndex = this.KiSubTask.TargetWaypointIndex;
  }

  public CApAPPWaypoint FirstWaypoint() => this.m_task.Waypoint(this.KiSubTask.SourceWaypointIndex);

  public CApAPPWaypoint LastWaypoint() => this.m_task.Waypoint(this.KiSubTask.TargetWaypointIndex);

  public string Name() => this.KiSubTask.Name;

  public bool IsToOptimize() => this.KiSubTask.IsToOptimize;

  public KiAppSubTaskEx KiSubTask
  {
    get => this.m_kiSubTask;
    set => this.m_kiSubTask = value;
  }
}
